public class FindMinⅡ {
    public int findMin(int[] nums) {
        //由于最右边的元素是边界，所以我们对比的对象要是该元素
        int left = 0;
        int right = nums.length - 1;
        while (left < right) {
            int mid = left + ((right - left) >> 1);
            if (nums[mid] < nums[right]) {
                right = mid;
            } else if (nums[mid] > nums[right]) {
                left = mid + 1;
            } else {
                //由于题目说明可能存在重复元素
                right --;
            }
        }
        return nums[left];
    }
}
